<?php

/**
 * @author edson
 * @copyright 2011
 */


$ruta=$_SERVER['DOCUMENT_ROOT']."/viventura/MDHoteles";
$ruta2=$_SERVER['DOCUMENT_ROOT']."/viventura";
$codigo=$_GET['codigo'];
$a=stripslashes($_GET['hh']);
$a = urldecode($a);
$a=unserialize($a);
echo count($a);



include_once("$ruta/conf/CConfig.php");
include_once("$ruta/elements/head2.tpl");

include_once("$ruta2/view/CDrawMenu.php");
include_once("$ruta2/view/CDrawPage.php");
include_once("$ruta/view/CDrawHotel.php");
include_once("$ruta2/view/CDrawPageReg.php");



$intance=new CDrawHotel();
?>
<script type="text/javascript">
$(document).ready(function () {
$('div#customise_editpanel').slideToggle("slow");
}); 
</script>
<?php
echo "<div id='customise_editpanel' style='visibility: visible; '>";//div +

CDrawPage::getInstance()->DrawDivBegin("customise_editpanel_rhs");//div ++1

echo"<h2> Hoteles Dentro del Tour </h2>";
echo "<div id='widget_picker_gallery' class='ui-sortable' style=''>";
$intance->DrawHoteles_of_Tour($codigo,$a);
CDrawPage::getInstance()->DrawDivEnd();

CDrawPage::getInstance()->DrawDivEnd();//div ++1




echo "<div class='customise_editpanel_instructions' >";//div++2

echo"<h2>Asignacion de Hoteles </h2>";
echo "<p> Use Arrastrar y soltar Para cambiar la Asignacion de Hoteles </p>";
echo "<p> Una vez guardada la Nueva configuracion se estableceran los Hoteles como 'Enviados'</p>";


CDrawPage::getInstance()->DrawDivEnd();//div++2



CDrawPage::getInstance()->DrawDivBegin("customise_page_view");//div++3

?>
<table cellspacing="0">

<tr>

<td valign="top" align="left" colspan="2"> </td>
<td valign="top" align="left" rowspan="2">
<h2></h2>
<div id="rightcolumn_widgets" class="ui-sortable ui-droppable" style="">

</div>
</td>



</tr>
<tr>
<td>
<h2>Hoteles Asignados dentro del Tour</h2>
<div id="leftcolumn_widgets" class="ui-sortable ui-droppable" style="">
<?php

$intance->DrawHoteles_of_Tour($a);
?>

</div>
</td>

<td>
<h2></h2>
<div id="middlecolumn_widgets" class="ui-sortable ui-droppable" style="">
<table class="draggable_widget" cellspacing="0" style=""></table>
</div>
</td>




</tr>
</table>

<?php
CDrawPage::getInstance()->DrawDivEnd();//div++3

CDrawPage::getInstance()->DrawFormBegin("#","formulario","POST");
//CDrawPage::getInstance()->DrawSubmmit();
 echo "<input class='submit_button' type='submit' onclick='getDiv()' >";



CDrawPage::getInstance()->DrawFormEnd();

CDrawPage::getInstance()->DrawDivEnd();//div+

echo "<div class='clearfloat'></div>";



include_once("$ruta/elements/foot.tpl");

?>
<script>
function getDiv()
{
    //var prueba=jQuery();
    var divs = $.map($("#leftcolumn_widgets").children('table.draggable_widget'), function(val){
                                        //alert($.parent().html())
                                        return val;
                                });
    $.each(divs, function(index,object)
    {   var n=index;
        alert(n);
        var pru=$(object);
        alert(pru);
        var pru2=pru.attr("id");
        alert(pru2);
        
    });
    
    
    
    //alert(data);
}
</script>


